<?php
/**
 * Date：2020-12-07 20:09
 * Title: 计算查询操作的执行时间
 * Description：
 * Error:
 */
$mysqli = new mysqli('127.0.0.1', 'root', '123456', 'mall');
$sql = "SELECT * FROM mall_admin_user";
$start = microtime();
$result = $mysqli->query($sql);
while ($obj = $result->fetch_object()) {
    echo "用户名：".$obj->username;
    echo "<br>";
}
$stop = microtime();
echo "查询操作所用的时间为：".($stop-$start);

